package security.controller;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import security.entity.User;
import security.service.UserService;

@RestController
public class AuthController {
    private final Logger logger = LoggerFactory.getLogger(this.getClass());

    @Autowired
    private UserService userService;

    @GetMapping("/deny/1")
    public void deny() {
        logger.info("============= deny =============");
    }
    @GetMapping("/rest/user/show/{id}")
    public User findById(@PathVariable Long id){
        return userService.findById(id);
    }

    @GetMapping("/rest/user/edit/{id}")
    public User none(@PathVariable Long id){
        return userService.findById(id);
    }
}
